-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update sessions.rst #7643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update sessions.rst #7643
Conversation
First step to explain how to activate Namespaced Attributes, as requested by symfony#7378
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment, nice PR, thanks!
|
||
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove` | ||
Deletes an attribute by key. | ||
Deletes an attribute by name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and returns its value.
As requested here :-) symfony#7643 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Hi, I would rather use a valid syntax example for services:
session:
class: Symfony\Component\HttpFoundation\Session\Session
arguments: ["@session.storage", "@session.namespacedattributebag", "@session.flash_bag"]
session.namespacedattributebag:
class: Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag |
Sorry, don't know what you mean - can't remember all details half a year later.... Do you want to add something, or do you want me to change something? |
session: | ||
class: Symfony\Component\HttpFoundation\Session\Session | ||
arguments: | ||
- @session.storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be @session.storage.native?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't care about the implementation here, so we don't need to be specific in that case and the alias is used. From Symfony 3.3, it should SessionStorageInterface
instead (autowired by default). See https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml#L21, that keeps BC with the old alias.
We can merge as is, thanks!
@ThomasLandauer sorry it took us so long to merge this. I like a lot your improvements. I only removed some example that showed how to configure this on Symfony. Since this is the stand-alone component doc, we never show how to integrate it with the whole framework. Thanks! |
As requested here :-) #7643 (review)
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #7643). Discussion ---------- Update sessions.rst First step to explain how to activate Namespaced Attributes, as requested by #7378 Commits ------- 22206d4 Reword and simplify e9dffc6 Update sessions.rst 5254aee Removed some repeated content and minor rewords 73a02c2 Update sessions.rst
@javiereguiluz Can the examples that showed how to configure Symfony be added to the Symfony session documentation? It took ma a while to find this PR to confirm how to use |
As requested here :-) symfony#7643 (review)
First step to explain how to activate Namespaced Attributes, as requested by #7378